<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <title>JQuery Validation Engine</title>
        <link rel="stylesheet" href="../css/validationEngine.jquery.css" type="text/css"/>
        <link rel="stylesheet" href="../css/template.css" type="text/css"/>
        <script src="../js/jquery-1.5.1.min.js" type="text/javascript">
        </script>
        <script src="../js/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8">
        </script>
        <script src="../js/jquery.validationEngine.js" type="text/javascript" charset="utf-8">
        </script>
        <script>
            jQuery(document).ready(function(){
                // binds form submission and fields to the validation engine
                jQuery("#formID").validationEngine('attach', {bindMethod:"live"});
                
            });
        </script>
    </head>
    <body>
        <p>
            <a href="#" onclick="alert('is the form valid? '+jQuery('#formID').validationEngine('validate'))">Evaluate form</a>
				 | <a href="#" onclick='jQuery("#formID").validationEngine("detach");'>Detach</a>

			| <a href="index.html" >Back to index</a>
        </p>
        <p>
            This demonstration shows how to use the predefined regular expressions 
        </p>
        <form id="formID" class="formular" method="post" action="">
            <fieldset>
                <legend>
                    Phone
                </legend>
                <label>
                    +103-304-340-4300-043
                    <br/>
                    +1 305 768 23 34 ext 23
                    <br/>
                    +1 (305) 768-2334 extension 703
                    <br/>
                    +1 (305) 768-2334 x703
                    <br/>
                    04312 / 777 777
                    <br/>
                    01-47.34/32 56
                    <br/>
                    (01865)  123456
                    <br/>
                    <span>Phone : </span>
                    <input value="+1 305 768 23 34 ext 23 BUG" class="validate[required,custom[phone]] text-input" type="text" name="telephone" id="telephone" />
                </label>
            </fieldset>
            <fieldset>
                <legend>
                    URL
                </legend>
                <label>
                    URL begin with http:// https:// or ftp://
                    <br/>
                    <span>Enter a URL : </span>
                    <input value="http://" class="validate[required,custom[url]] text-input" type="text" name="url" id="url" />
                </label>
            </fieldset>
            <fieldset>
                <legend>
                    Email
                </legend>
                <label>
                    <span>Email address : </span>
                    <input value="forced_error" class="validate[required,custom[email]] text-input" type="text" name="email" id="email" />
                </label>
            </fieldset>
            <fieldset>
                <legend>
                    IP Address
                </legend>
                <label>
                    <span>IP: </span>
                    <input value="192.168.3." class="validate[required,custom[ipv4]] text-input" type="text" name="ip" id="ip" />
                </label>
            </fieldset>
            <fieldset>
                <legend>
                    Date
                </legend>
                <label>
                    ISO 8601 dates only YYYY-mm-dd
                    <br/>
                    <span>Date: </span>
                    <input value="201-12-01" class="validate[required,custom[date]] text-input" type="text" name="date" id="date" />
                </label>
            </fieldset>
            <fieldset>
                <legend>
                    Number
                </legend>
                <label>
                    a signed floating number, ie: -3849.354, 38.00, 38, .77
                    <br/>
                    <span>Number: </span>
                    <input value="-33.87a" class="validate[required,custom[number]] text-input" type="text" name="number" id="number" />
                </label>
            </fieldset>
            <fieldset>
                <legend>
                    Integer
                </legend>
                <label>
                    an signed integer: ie +34, 34 or -1
                    <br/>
                    <span>Number: </span>
                    <input value="10.1" class="validate[required,custom[integer]] text-input" type="text" name="integer" id="integer" />
                </label>
            </fieldset>
            <fieldset>
                <legend>
                    onlyLetterNumber
                </legend>
                <label>
                    <span>only [0-9a-zA-Z]</span>
                    <input value="too many spaces obviously" class="validate[required,custom[onlyLetterNumber]] text-input" type="text" name="special" id="special" />
                </label>
            </fieldset>
            <fieldset>
                <legend>
                    Only Numbers (char)
                </legend>
                <label>
                    <span>only [0-9] and space</span>
                    <input value="10.1" class="validate[required,custom[onlyNumberSp]] text-input" type="text" name="onlynumber" id="onlynumber" />
                </label>
            </fieldset>
            <fieldset>
                <legend>
                    OnlyLetter
                </legend>
                <label>
                    <span>only ascii letters, space and '</span>
                    <input value="this is an invalid char '.'" class="validate[required,custom[onlyLetterSp]] text-input" type="text" name="onlyascii" id="onlyascii" />
                </label>
            </fieldset><input class="submit" type="submit" value="Validate & Send the form!"/><hr/>
        </form>
        

        
        
    </body>
</html>